package com.huang.controller;

import com.huang.resp.CommonResult;
import com.huang.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author han
 * @since 2022-01-07 15:10:29
 */
@Slf4j
@RestController
@RequestMapping("user")
public class UserController {

    @Resource
    private UserService userService;

    @GetMapping("token/{type}")
    public CommonResult getToken(@PathVariable("type") Integer type) {
        log.info("type is {}", type);
        return userService.getToken(type);
    }

    @GetMapping("info")
    public CommonResult info() {
        return userService.info();
    }

}
